﻿<Window x:Class="InkCanvasControls.PenStyles"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:self="clr-namespace:InkCanvasControls"
    Title="Choose style..." WindowStyle="ToolWindow" Topmost="True" ResizeMode="CanResizeWithGrip" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen">
    
    <Window.Resources>
        <self:ThicknessToFillValueConverter x:Key="ThicknessToFill"/>
    </Window.Resources>

    <StackPanel x:Name="AllStyles" Orientation="Horizontal">
        
        <!-- Style selections for Pen tool-->
        <StackPanel x:Name="PenStyle" Orientation="Horizontal" Width="265" Visibility="{Binding PenStyleVisibility}">
            <GroupBox Header="Colour">
                <StackPanel x:Name="Colours" Orientation="Vertical">
                    <RadioButton x:Name="BlackColour" VerticalAlignment="Center" Margin="5" Checked="PenColourButton_Checked" ToolTip="Black">
                        <Line X1="0" Y1="5" X2="50" Y2="5" Stroke="Black" StrokeThickness="{Binding SelectedThickness}"/>
                    </RadioButton>
                    <RadioButton x:Name="RedColour" VerticalAlignment="Center" Margin="5" Checked="PenColourButton_Checked" ToolTip="Red">
                        <Line X1="0" Y1="5" X2="50" Y2="5" Stroke="Red" StrokeThickness="{Binding SelectedThickness}"/>
                    </RadioButton>
                    <RadioButton x:Name="BlueColour" VerticalAlignment="Center" Margin="5" Checked="PenColourButton_Checked" ToolTip="Blue">
                        <Line X1="0" Y1="5" X2="50" Y2="5" Stroke="Blue" StrokeThickness="{Binding SelectedThickness}"/>
                    </RadioButton>
                    <RadioButton x:Name="CustomColour" Margin="5" Checked="CustomColour_Checked">
                        <self:CustomColour ChosenColour="{Binding Path=CustomColourSelected, Mode=TwoWay}"
                                           ColourSelected="CustomColour_ColourSelected"/>
                    </RadioButton>
                </StackPanel>
            </GroupBox>

            <GroupBox Header="Width">
                <StackPanel x:Name="Widths" Orientation="Vertical">
                    <RadioButton x:Name="ThinWidth" VerticalAlignment="Center" Margin="5" Checked="WidthButton_Checked" ToolTip="Thin">
                        <Line X1="0" Y1="5" X2="50" Y2="5" Stroke="{Binding SelectedPenBrush}" StrokeThickness="2"/>
                    </RadioButton>
                    <RadioButton x:Name="MediumWidth" VerticalAlignment="Center" Margin="5" Checked="WidthButton_Checked" ToolTip="Medium">
                        <Line X1="0" Y1="5" X2="50" Y2="5"  Stroke="{Binding SelectedPenBrush}" StrokeThickness="3"/>
                    </RadioButton>
                    <RadioButton x:Name="ThickWidth" VerticalAlignment="Center" Margin="5" Checked="WidthButton_Checked" ToolTip="Thick">
                        <Line X1="0" Y1="5" X2="50" Y2="5"  Stroke="{Binding SelectedPenBrush}" StrokeThickness="4"/>
                    </RadioButton>
                </StackPanel>
            </GroupBox>

            <GroupBox Header="Tip">
                <StackPanel x:Name="Tips" Orientation="Vertical" VerticalAlignment="Center">
                    <RadioButton x:Name="SquareTip" Margin="5" Checked="TipButton_Checked" ToolTip="Square tip">
                        <Rectangle Width="{Binding SelectedThickness, Converter={StaticResource ThicknessToFill}}"
                               Height="{Binding SelectedThickness, Converter={StaticResource ThicknessToFill}}"
                               Fill="{Binding SelectedPenBrush}"/>
                    </RadioButton>
                    <RadioButton x:Name="RoundTip" Margin="5" Checked="TipButton_Checked" ToolTip="Round tip">
                        <Ellipse Width="{Binding SelectedThickness, Converter={StaticResource ThicknessToFill}}"
                               Height="{Binding SelectedThickness, Converter={StaticResource ThicknessToFill}}"
                               Fill="{Binding SelectedPenBrush}"/>
                    </RadioButton>

                </StackPanel>
            </GroupBox>
        </StackPanel>

        <!-- Style selections for Highlighter tool-->
        <StackPanel x:Name="HiliterStyle" Orientation="Horizontal" Width="100" Visibility="{Binding HighliterStyleVisibility}">
            <GroupBox Header="Colour">
                <StackPanel x:Name="Highlights" Orientation="Vertical">
                    <RadioButton x:Name="YellowColour" VerticalAlignment="Center" Margin="5" Checked="HiliteColourButton_Checked" ToolTip="Yellow highlight">
                        <Line X1="0" Y1="7" X2="50" Y2="7" Stroke="Yellow" StrokeThickness="8"/>
                    </RadioButton>
                    <RadioButton x:Name="FuchsiaColour" VerticalAlignment="Center" Margin="5" Checked="HiliteColourButton_Checked" ToolTip="Pink highlight">
                        <Line X1="0" Y1="7" X2="50" Y2="7" Stroke="Fuchsia" StrokeThickness="8"/>
                    </RadioButton>
                    <RadioButton x:Name="LimeColour" VerticalAlignment="Center" Margin="5" Checked="HiliteColourButton_Checked" ToolTip="Green highlight">
                        <Line X1="0" Y1="7" X2="50" Y2="7" Stroke="Lime" StrokeThickness="8"/>
                    </RadioButton>
                </StackPanel>
            </GroupBox>
        </StackPanel>        
    </StackPanel>
</Window>
